<?php

/**
 * Interaction form base class.
 *
 * @method Interaction getObject() Returns the current form's model object
 *
 * @package    Web20
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseInteractionForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                 => new sfWidgetFormInputHidden(),
      'identifier'         => new sfWidgetFormInputText(),
      'display_name'       => new sfWidgetFormInputText(),
      'service_name'       => new sfWidgetFormInputText(),
      'preferred_username' => new sfWidgetFormInputText(),
      'formated_name'      => new sfWidgetFormInputText(),
      'family_name'        => new sfWidgetFormInputText(),
      'given_name'         => new sfWidgetFormInputText(),
      'middle_name'        => new sfWidgetFormInputText(),
      'gender'             => new sfWidgetFormInputText(),
      'birthday'           => new sfWidgetFormDate(),
      'email'              => new sfWidgetFormInputText(),
      'verified_email'     => new sfWidgetFormInputText(),
      'url'                => new sfWidgetFormInputText(),
      'phone'              => new sfWidgetFormInputText(),
      'photo'              => new sfWidgetFormInputText(),
      'formated_address'   => new sfWidgetFormInputText(),
      'street_address'     => new sfWidgetFormInputText(),
      'locality'           => new sfWidgetFormInputText(),
      'region'             => new sfWidgetFormInputText(),
      'postal_code'        => new sfWidgetFormInputText(),
      'country'            => new sfWidgetFormInputText(),
      'user_id'            => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('User'), 'add_empty' => true)),
      'created_at'         => new sfWidgetFormDateTime(),
      'updated_at'         => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                 => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'id', 'required' => false)),
      'identifier'         => new sfValidatorString(array('max_length' => 200, 'required' => false)),
      'display_name'       => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'service_name'       => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'preferred_username' => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'formated_name'      => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'family_name'        => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'given_name'         => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'middle_name'        => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'gender'             => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'birthday'           => new sfValidatorDate(array('required' => false)),
      'email'              => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'verified_email'     => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'url'                => new sfValidatorString(array('max_length' => 200, 'required' => false)),
      'phone'              => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'photo'              => new sfValidatorString(array('max_length' => 200, 'required' => false)),
      'formated_address'   => new sfValidatorString(array('max_length' => 200, 'required' => false)),
      'street_address'     => new sfValidatorString(array('max_length' => 200, 'required' => false)),
      'locality'           => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'region'             => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'postal_code'        => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'country'            => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'user_id'            => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('User'), 'required' => false)),
      'created_at'         => new sfValidatorDateTime(),
      'updated_at'         => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('interaction[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Interaction';
  }

}
